BUG: heightFunction implementation gives wrong results in parallel - #72
BUG: heightFunction implementation gives wrong results in parallel#72gkoukou wants to merge 1 commit into
Conversation
…d with non-uniform mesh heightFunction::correct() used the mesh average cell delta to calculate curvature. This gives wrong results in cases using AMR where the mesh is locally refined. In heightFunction::computeColumns, a return statement was added because the iterator would advance even when the current cell was not local anymore, leading to incomplete column. In case a parallel stencil was found in the primary direction, the code would add it to the parallelStencil list and then continue testing the next direction. A break statement was added to avoid this. Parallel columns would skip calculation of the first cell across the processor boundary. Finally, K_.correctBoundaryConditions() which is needed for correct interpolation of the curvature field on the faces later.
|
Hi @gkoukou Thank you very much for this contribution! Would you mind providing a small, simple case (with an Allrun and an Allclean script) exhibiting the bug you fixed, and a description of how to postprocess the case to see the bug (e.g. with a paraview pvsm file)? Kind regards, |
|
Dear professor Roenby, Thank you for your response. Here is a case for a translating droplet using static mesh. The results look fine until t = 0.12 but then the curvature error spikes. Here is a comparison between the old (top) and new (bottom) implementations. The bug can be visualized in paraview by viewing the curvature field K_. Additionally, a plotKrms.gpi gnuplot script is provided in the post/ folder which plots the relative curvature RMS error. Best regards, |
|
@gkoukou : @HenningScheufler : |
|
@isoAdvector: The circle has a radius of 0.2 so the curvature should evaluate to 5. This is the comparison of the results where the curvature on the left using the original code evaluates to 2.8 while the corrected code on the right gives 5. Best regards, |
|
Thanks for the clarification and the additional test case, @gkoukou Awaiting @HenningScheufler having a look at the code changes. Thanks again for the contribution! |


heightFunction::correct() used the mesh average cell delta to calculate curvature. This gives wrong results in cases using AMR where the mesh is locally refined.
In heightFunction::computeColumns, a return statement was added because the iterator would advance even when the current cell was not local anymore, leading to incomplete column.
In case a parallel stencil was found in the primary direction, the code would add it to the parallelStencil list and then continue testing the next direction. A break statement was added to avoid this.
Parallel columns would skip calculation of the first cell across the processor boundary. Finally, K_.correctBoundaryConditions() which is needed for correct interpolation of the curvature field on the faces later.